package com.xique.blelock.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * Created by Administrator on 2018/12/12.
 */

public class FingerInfo implements Serializable , Parcelable{
//     "uid": "390ade59a4fc4fa3bef040d9107a1181",
//             "role": 0,  0;管理员  1;已绑定锁普通用户
//             "nickname": "001",
//             "order": 1,  超级管理员的指纹号是1号，福超级管理可以随意指定
//             "feature": "xxxxx",
//             "time": 1537940000
    private String uid = "";
    private int role;
    private String nickname ="";
    private int order;
    private String feature ="";
    private long time;

    public static final int RootRole = 1;
    public static final int SecondRootRole = 0;

    //辅助swipemenu  记录当前有几个自菜单

    private int menunum;

    public FingerInfo() {
    }

    public FingerInfo(int order) {
        this.order = order;
    }

    protected FingerInfo(Parcel in) {
        uid = in.readString();
        role = in.readInt();
        nickname = in.readString();
        order = in.readInt();
        feature = in.readString();
        time = in.readLong();
    }

    public static final Creator<FingerInfo> CREATOR = new Creator<FingerInfo>() {
        @Override
        public FingerInfo createFromParcel(Parcel in) {
            return new FingerInfo(in);
        }

        @Override
        public FingerInfo[] newArray(int size) {
            return new FingerInfo[size];
        }
    };


    public int getMenunum() {
        return menunum;
    }

    public void setMenunum(int menunum) {
        this.menunum = menunum;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getFeature() {
        return feature;
    }

    public void setFeature(String feature) {
        this.feature = feature;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(uid);
        dest.writeInt(role);
        dest.writeString(nickname);
        dest.writeInt(order);
        dest.writeString(feature);
        dest.writeLong(time);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FingerInfo that = (FingerInfo) o;

        return order == that.order;
    }

    @Override
    public int hashCode() {
        return role;
    }
}
